from toolsSrc.files.checkFiles import checkCsvFiles
from common.config import torqueConfig as Config
import pandas as pd


''' 用于 PLC 通讯 ################################################################### ‘’‘
’‘’
转矩优化之后，将转矩系数调整值 copy to torqueUpload.csv
'''
def toTorqUploadCsv():
    if checkCsvFiles([Config.torqCoefAdjProcess]) is False:
        return

    df_from = pd.read_csv(Config.torqCoefAdjProcess)
    df_to = pd.DataFrame({Config.torquePlcKey: [df_from['UploadTorqCoef'][0]]})
    print(Config.torquePlcKey,df_from['UploadTorqCoef'][0] )
    df_to.to_csv(Config.torqueUpload)
